<template>
    <div class="monitoring">
        <div class="monitoring-item" v-for="(item, index) in props.list" :key="index">
            <div class="left">
                <img class="back" :src="item.img" alt="" />
                <div class="info">
                    <img src="@/assets/images/基础/monitor/point_pic.png" alt="" />
                    <div class="name">{{ item.name }}</div>
                </div>
            </div>
            <div class="right">
                <div class="item">
                    <div class="title">出入通道</div>
                    <div class="content">{{ item.passage }}</div>
                </div>
                <div class="item">
                    <div class="title">行车方向</div>
                    <div class="content pass">{{ item.direction }}</div>
                </div>
                <div class="item">
                    <div class="title">出入时间</div>
                    <div class="content">{{ item.time }}</div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { getAssetsFile } from '@/utils'

interface listType {
    img: string
    name: string
    passage: string
    direction: string
    time: string
}

const props = defineProps({
    list: {
        type: Array<listType>,
        default: () => [
            {
                img: getAssetsFile('基础/monitor/监控.png'),
                name: '粤A N1024',
                passage: '网箱监测点A',
                direction: '驶入',
                time: '2023-11-20 14:20:10'
            },
            {
                img: getAssetsFile('基础/monitor/监控.png'),
                name: '粤A N1024',
                passage: '网箱监测点A',
                direction: '驶入',
                time: '2023-11-20 14:20:10'
            }
        ]
    }
})
</script>

<style scoped lang="scss">
.monitoring {
    width: 100%;
    display: flex;
    justify-content: space-around;
    position: relative;
    padding: 0 0 20px 0;
    color: #fff;
    .monitoring-item {
        position: relative;
        display: flex;
        justify-content: space-between;
        .left {
            position: relative;
            overflow: hidden;
            .back {
                width: 250px;
                border-radius: 10px;
                height: 100%;
                cursor: pointer;
            }
            .info {
                position: absolute;
                bottom: 0;
                left: 0;
                display: flex;
                align-items: center;
                padding: 5px 5px 5px 10px;
                width: 100%;
                background-image: linear-gradient(180deg, #05080900 0%, #0d1e39 100%);
                font-size: 18px;
                img {
                    width: 20px;
                    height: 20px;
                }
                .name {
                    letter-spacing: 1px;
                }
            }
        }

        .right {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 10px;
            letter-spacing: 0.5px;
            font-size: 18px;
            font-family: OPPOSans;
            .item {
                .title {
                    margin-bottom: 10px;
                    letter-spacing: 1px;
                }
                .content {
                    color: #89cbff;
                }
                .pass {
                    color: #72fff7;
                }
            }
        }
    }
}
</style>
